<template>
    <div class="content">
        <div class="search">
            <van-search :clearable="false" v-model="value" style="width: 85%;" shape="round" background="#17171a"
                :placeholder="$t('搜索')" />
            <div class="cancel" @click="router.back()">{{ $t('取消') }}</div>
        </div>
        <div class="text" v-if="value == ''">
            {{ $t('熱門搜索') }}
        </div>
        <ul class="ul" v-if="value == ''">
            <li class="item" v-for="(item, index) in 8">
                <div class="left">{{ index + 1 }} <span>BNB/USDT</span></div>
                <div class="right">
                    <div class="le">
                        <div class="top">3.1498</div>
                        <div :style="{ color: num > 0 ? '#2ebd85' : '#f5465d' }" class="btm">{{ num + "%" }}</div>
                    </div>
                    <div class="ri">
                        <van-rate class="star" clearable color="#ffd21e" void-color="#eee" :count="1" v-model="score" />
                    </div>
                </div>
            </li>
        </ul>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router';
const router = useRouter();

const value = ref('')
const num = ref(-0.1)
const score = ref(0)

</script>

<style lang="scss" scoped>
.content {
    background-color: #17171a;
    height: 100vh;
}

::v-deep input {
    caret-color: #fff;
    color: #fff;
}

.van-search {
    background-color: #17171a;
}

::v-deep .van-search__content {
    background: #232830;
}

.search {
    display: flex;
    // justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;

    .cancel {
        flex: 1;
        font-size: 14px;
        color: #f2ce3d;
    }
}

.text {
    font-size: 15px;
    color: #fff;
    padding: 0 15px;
}

.ul {
    padding: 0 15px;

    .item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        height: 50px;
        padding: 10px 0;
        box-sizing: border-box;

        .left {
            font-size: 15px;
            color: #fff;
        }

        .right {
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: #fff;

            .le {
                margin-right: 20px;

                .top {
                    font-size: 15px;
                }

                .btm {
                    font-size: 13px;
                    float: right;
                }
            }

            .ri {
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
        }
    }
}
</style>